<html>
<head>
<link href="../style/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<p class="heading">
Mouse Module (last update 10/05/01)
</p>
<p class="subheading">
Description:
</p>
<p>
The module adds mouse support to your game/animation. This includes reading the position and state of the
mouse, and triggering mouse actions on sprite and layer objects.
</p>
<p class="subheading">
To use:
</p>
<p>
The code can be linked in to your script by adding this line to the &lt;HEAD&gt; section of your document:
</p>
<p class="jcode">
&lt;script language="Javascript" src="gamelib_mouse.js"&gt;&lt;/script&gt;
</p>
<p>
You then instantiate the mouse by adding the following to your script:
</p>
<p class="jcode">
myMouse=Ms_initmouse();
</p>

<p class="subheading">
List of methods for mouse module
</p>

<p>
<a href="#disable">disable</a><br>
<a href="#enable">enable</a><br>
</p>

<p class="subheading">
List of properties for mouse module
</p>

<p>
<a href="#mousedown">mousedown</a><br>
<a href="#onstate">onstate</a><br>
<a href="#over">over</a><br>
<a href="#x">x</a><br>
<a href="#xoff">xoff</a><br>
<a href="#y">y</a><br>
<a href="#yoff">yoff</a><br>
<a href="#z">z</a><br>
</p>


<p class="subheading">
Descriptions of methods
</p>

<table>
<tr>
<th>Method</th><th NOWRAP>Parameters</th><th>Description</th>
</tr>
<tr>
<a name="disable">
<td>disable</td><td>(none)</td><td>This disables the sprite mouse event triggers. This may be of use if
						you don't actually need the mouse very often and wish to save CPU cycles.
		  				While the mouse handler is optimized, it's still better not to have it
						enabled if you don't need it! The mouse object you have set up will still
						report the mouse position and button state, but will not update the over
						property and the sprite event triggers will not function
</td>
</tr>
<tr>
<a name="enable">
<td>enable</td><td>(none)</td><td>This is called when you first initialize the mouse object, and can be used
						to re-enable the mouse event triggers if you disable them
</td>
</tr>
</table>


<p class="subheading">
Descriptions of properties
</p>

<table>
<tr>
<th>Property</th><th NOWRAP>Data Type</th><th NOWRAP>Read/Write</th><th>Description</th>
</tr>
<tr>
<a name="x">
<td>x</td><td>Numeric</td><td>R</td><td>The x position of mouse _RELATIVE_ to Sp_xoffset (see <a href="spritedoc.html#SPxoffset">sprite docs</a> about this global variable)</td>
</tr>
<tr>
<a name="y">
<td>y</td><td>Numeric</td><td>R</td><td>The y position of mouse _RELATIVE_ to Sp_yoffset (see <a href="spritedoc.html#SPyoffset">sprite docs</a> about this global variable)</td>
</tr>
<tr>
<a name="mousedown">
<td>mousedown</td><td>Boolean</td><td>R</td><td>Used to determine whether the mouse button is pressed down</td>
</tr>
<tr>
<a name="over">
<td>over</td><td>Object</td><td>R</td><td>If not NULL, then this is the sprite or layer the mouse pointer is over.
					  Sprites and layers actually have their own mouse event triggers, see the <a href="spritedoc.html#onmouseover">sprite docs</a> or <a href="layerdoc.html#onclickdown">layer docs</a> for details</td>
</tr>
<tr>
<a name="xoff">
<td>xoff</td><td>Numeric</td><td>R</td><td>The position of the mouse in the x axis relative to sprite/layer it's over</td>
</tr>
<tr>
<a name="yoff">
<td>yoff</td><td>Numeric</td><td>R</td><td>The position of the mouse in the y axis relative to sprite/layer it's over</td>
</tr>
<tr>
<a name="z">
<td>z</td><td>Numeric</td><td>R</td><td>The z index of the sprite/layer the mouse is over. Used internally</td>
</tr>
<tr>
<a name="onstate">
<td>onstate</td><td>Boolean</td><td>R</td><td>Used internally</td>
</tr>
</table>

</body>
</html>